package java8;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class StreamTest {
    public static void main(String[] args) {
        Integer[] integers = {1, 3, null, 2, 3, 4, null, 5, 6, 7, 8, 9, 10};
        List<Integer> numList = Arrays.asList(integers);
        List<Integer> list = numList.stream()
                .filter(num -> num != null && num > 2)
                .distinct()
                .sorted()
                .collect(Collectors.toList());
        System.out.println(list) ;
        System.out.println(numList);
    }
}
